<template>
  <span>
    <router-link v-if="to" :to="to">
      <slot />
    </router-link>
    <span v-else><slot /></span>
  </span>
</template>

<script>
export default {
// 1.封装一个面包屑item组件接收一个to参数
  name: 'BreadcrumbItem',
  props: {
    to: {
      type: [Object, String],
      default: ''
    }
  }
}
</script>

<style>

</style>
